package com.crm.service;

import com.crm.domain.Customer;

import javax.ws.rs.*;
import java.util.List;

/**
 * @author misterWei
 * @create 2018年11月15号:10点10分
 * @mailbox mynameisweiyan@gmail.com
 */


//远程调用接口  使用 JAX-RS方式

public interface CustomerService {

    //查询没有被定区关联的客户
      @Path("/notCustomerConFiexdArea")
      @GET
      @Produces({"application/xml","application/json"})
   public List<Customer> findIsNullfixedArea();

    //查询已经被关联的客户
    @Path("/conCustomerAndFiexdArea/{fixedAreaId}")
    @GET
    @Produces({"application/xml","application/json"})
    public List<Customer> findConfixedArea(@PathParam("fixedAreaId") String fixedAreaId);


    //修改客户于定区的关联关系
    @PUT
    @Path("/upCustomerOrFiexdArea/{customerId}/{fixedAreaId}")
    //使用Query注解的方式来接受参数,不在进行参数{}方式
   public void customerToFixedArea(@PathParam("customerId") String customerId,@PathParam("fixedAreaId") String fixedAreaId);
    //保存注册的基本信息设置
    @Path("/saveCustomer")
    @POST
    @Consumes({"application/xml","application/json"})
    public void saveCustomer(Customer customer);

    //查询指定手机号的Customer的信息
     @Path("/findTelephone/{telephone}")
     @GET
     @Produces({"application/xml","application/json"})
     @Consumes({"application/xml","application/json"})
    public Customer findTelephone(@PathParam("telephone") String telephone);


    //更改邮箱状态信息
    @Path("/updateEmailStatus/{telephone}")
    @GET
    public void updateEmailStatus(@PathParam("telephone") String telephone);

    @Path("/login/{telephone}/{password}")
    @GET
    @Produces({"application/xml","application/json"})
    public Customer login(@PathParam("telephone") String telephone,@PathParam("password") String password);

   @Path("/findFixedAreaByAddress")
   @GET
   @Produces({"application/xml","application/json"})
 public String findFixedAreaByAddress(@QueryParam("address") String address);

}
